define(function(require, exports, module){
	var aboutUsTemp = require("text!../template/personalcenter.html");

	module.exports = Nuui.View.extend({

		template:aboutUsTemp,

		onRender:function(){
			var view = this;

			App.request(App.server.getServePath(App.path.getSessionId), {
				success:function(data){
					if(data.ec){
						alert(data.em);
					}else{
						var res=data.body;
						view.$("#userNameCn").text(res.useName);
                        view.$("#aviBalance").text(res.nickMoney);
					}
				}
			})
		},

		onShow:function(){
            $("#myOrder").on("tap", function(){
                App.navigate("example/personalCenter/myorder", true);
                return false;
            });
            $("#RechargeCenter").on("tap", function(){
                App.navigate("example/personalCenter/vouchercenter", true);
                return false;
            });
            $("#mycollect").on("tap", function(){
                App.navigate("example/personalCenter/mycollects", true);
                return false;
            });
            $("#MyFocus").on("tap", function(){
                App.navigate("example/personalCenter/myfocus", true);
                return false;
            });
            $("#preImg").on("tap", function(){
                App.navigate("example/personalCenter/membership", true);
                return false;
            });

		}

	});
});
